import {Component} from "react";

export default class Counter extends Component{
    constructor(props){
        super(props);
        this.name = "katy";
        this.state = {
            count: 0,
            c:"a"
        }
        this.count = this.count.bind(this);
    }

    count(e){
        // var c = this.state.cousnt+1;
        var c = this.state.c+this.state.c;
        this.setState({
            c
        });
        this.name = this.name=="katy"?"win7":"katy";
    }

    render(){
        console.log(this.name);
        return (
            <div>
                <div>counter:{this.state.count}</div>
                <div>
                    <button onClick={this.count}>counter</button>
                </div>
            </div>
        )
    }
}